package com.wpre.mybatisplus.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.wpre.mybatisplus.model.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LianBao
 * Date: 2024-11-17
 * Time: 17:04
 */

@Mapper
public interface UserInfoMapper extends BaseMapper<UserInfo> {
//    @Select("select id,username,password,age from user_info where age=#{age} ")
//    List<UserInfo> selectByCustom(Integer age);

    @Select("select id,username,password,age from user_info ${ew.customSqlSegment}")
    List<UserInfo> selectByCustom(@Param(Constants.WRAPPER) Wrapper<UserInfo> wrapper);
}
